package com.ez.supervise.dao.impl;

import java.util.List;

import com.ez.supervise.core.Page;
import com.ez.supervise.dao.GoalDetailDao;
import com.ez.supervise.dao.base.BaseDaoImpl;
import com.ez.supervise.model.biz.GoalDetail;

public class GoalDetailDaoImpl extends BaseDaoImpl implements GoalDetailDao {

	public void insert(Object goalDetail) {
		sqlMapClientTemplate.insert("biz.insertGoalDetail", goalDetail);
	}

	public Object get(Long id) {
		return (GoalDetail) sqlMapClientTemplate.queryForObject(
				"biz.getGoalDetailById", id);
	}

	public void update(Object org) {
		sqlMapClientTemplate.update("biz.updateGoalDetail", org);
	}

	public void delete(Long id) {
		sqlMapClientTemplate.update("biz.deleteGoalDetail", id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ez.supervise.dao.GoalDetailDao#findByCount(com.ez.supervise.core.
	 * Page)
	 */
	public int findGoalDetailByCount(Page page) {
		return (Integer) getSqlMapClientTemplate().queryForObject(
				"biz.findGoalDetailByCount", page.getConditions());
	}
	public int queryGoalDetailByCount(Page page) {
		return (Integer) getSqlMapClientTemplate().queryForObject(
				"biz.queryGoalDetailByCount", page.getConditions());
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.ez.supervise.dao.GoalDetailDao#findAll()
	 */
	public List findAll() {
		return getSqlMapClientTemplate().queryForList("biz.findAllGoalDetail");
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ez.supervise.dao.GoalDetailDao#findGoalDetailByPage(com.ez.supervise
	 * .core.Page)
	 */
	public List findGoalDetailByPage(Page page) {
		return getSqlMapClientTemplate().queryForList(
				"biz.findGoalDetailByPage", page.getConditions());
	}

	public List queryGoalDetailByPage(Page page) {
		return getSqlMapClientTemplate().queryForList(
				"biz.queryGoalDetailByPage", page.getConditions());
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ez.supervise.dao.GoalDetailDao#findGoalByCategroy(java.lang.Long)
	 */
	public List<GoalDetail> findGoalByCategroy(Long categoryId) {
		return (List<GoalDetail>) getSqlMapClientTemplate().queryForList(
				"biz.findGoalByCategroy", categoryId);
	}

	public void auditGoalDetail(GoalDetail goalDetail) {
		sqlMapClientTemplate.update("biz.auditGoalDetail", goalDetail);

	}

	public int findGoalDetailApplyByCount(Page page) {
		return (Integer) getSqlMapClientTemplate().queryForObject(
				"biz.findGoalDetailApplyByCount", page.getConditions());
	}

	public List findGoalDetailApplyByPage(Page page) {
		return getSqlMapClientTemplate().queryForList(
				"biz.findGoalDetailApplyByPage", page.getConditions());
	}

}
